package utils;

import com.google.gson.Gson;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class Util {
    public static void WriteJson(Object obj, HttpServletResponse response) throws IOException {
        response.setContentType("application/html;charset=utf-8");
        String json = new Gson().toJson(obj);
        response.getWriter().append(json);
    }
}
